Added VBD. and VIF.qos_supported_algorithms fields, with C bindings, Xend
authorEwan Mellor <ewan@xensource.com>
Wed, 21 Feb 2007 23:03:00 +0000 (23:03 +0000)
committerEwan Mellor <ewan@xensource.com>
Wed, 21 Feb 2007 23:03:00 +0000 (23:03 +0000)
implementation to follow.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
docs/xen-api/xenapi-datamodel.tex
tools/libxen/include/xen_vbd.h
tools/libxen/include/xen_vif.h
tools/libxen/src/xen_vbd.c
tools/libxen/src/xen_vif.c

index 82c3bea252c52e231a54bb35fc175fec4ead1167..c2b7f452c0e7c75d6e1daa9f6122dfe651ed5425 100644 (file)
@@ -6680,7 +6680,8 @@ $\mathit{RO}_\mathit{ins}$ &  {\tt VM} & VM ref & virtual machine to which this
 $\mathit{RW}$ &  {\tt MAC} & string & ethernet MAC address of virtual interface, as exposed to guest \\
 $\mathit{RW}$ &  {\tt MTU} & int & MTU in octets \\
 $\mathit{RW}$ &  {\tt qos/algorithm\_type} & string & QoS algorithm to use \\
-$\mathit{RW}$ &  {\tt qos/algorithm\_params} & (string $\rightarrow$ string) Map & Paramters for chosen QoS algorithm \\
+$\mathit{RW}$ &  {\tt qos/algorithm\_params} & (string $\rightarrow$ string) Map & parameters for chosen QoS algorithm \\
+$\mathit{RO}_\mathit{run}$ &  {\tt qos/supported\_algorithms} & string Set & supported QoS algorithms for this VIF \\
 $\mathit{RO}_\mathit{run}$ &  {\tt metrics} & VIF\_metrics ref & metrics associated with this VIF. \\
 \hline
 \end{longtable}
@@ -7181,6 +7182,38 @@ void
 
 
 
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_qos\_supported\_algorithms}
+
+{\bf Overview:} 
+Get the qos/supported\_algorithms field of the given VIF.
+
+ \noindent {\bf Signature:} 
+\begin{verbatim} (string Set) get_qos_supported_algorithms (session_id s, VIF ref self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt VIF ref } & self & reference to the object \\ \hline 
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:} 
+{\tt 
+string Set
+}
+
+
+value of the field
 \vspace{0.3cm}
 \vspace{0.3cm}
 \vspace{0.3cm}
@@ -9787,8 +9820,9 @@ $\mathit{RW}$ &  {\tt bootable} & bool & true if this VBD is bootable \\
 $\mathit{RW}$ &  {\tt mode} & vbd\_mode & the mode the VBD should be mounted with \\
 $\mathit{RW}$ &  {\tt type} & vbd\_type & how the VBD will appear to the guest (e.g. disk or CD) \\
 $\mathit{RW}$ &  {\tt qos/algorithm\_type} & string & QoS algorithm to use \\
-$\mathit{RW}$ &  {\tt qos/algorithm\_params} & (string $\rightarrow$ string) Map & Paramters for chosen QoS algorithm \\
-$\mathit{RO}_\mathit{run}$ &  {\tt metrics} & VBD\_metrics ref & metrics associated with this VBD. \\
+$\mathit{RW}$ &  {\tt qos/algorithm\_params} & (string $\rightarrow$ string) Map & parameters for chosen QoS algorithm \\
+$\mathit{RO}_\mathit{run}$ &  {\tt qos/supported\_algorithms} & string Set & supported QoS algorithms for this VBD \\
+$\mathit{RO}_\mathit{run}$ &  {\tt metrics} & VBD\_metrics ref & metrics associated with this VBD \\
 \hline
 \end{longtable}
 \subsection{Additional RPCs associated with class: VBD}
@@ -10389,6 +10423,38 @@ void
 
 
 
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_qos\_supported\_algorithms}
+
+{\bf Overview:} 
+Get the qos/supported\_algorithms field of the given VBD.
+
+ \noindent {\bf Signature:} 
+\begin{verbatim} (string Set) get_qos_supported_algorithms (session_id s, VBD ref self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt VBD ref } & self & reference to the object \\ \hline 
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:} 
+{\tt 
+string Set
+}
+
+
+value of the field
 \vspace{0.3cm}
 \vspace{0.3cm}
 \vspace{0.3cm}
index 543a42288c8efe561957d20379c7ceed15e8e87c..848988760506406211d979d8fbe0bb29f72fa460 100644 (file)
@@ -20,6 +20,7 @@
 #define XEN_VBD_H
 
 #include "xen_common.h"
+#include "xen_string_set.h"
 #include "xen_string_string_map.h"
 #include "xen_vbd_decl.h"
 #include "xen_vbd_metrics_decl.h"
@@ -77,6 +78,7 @@ typedef struct xen_vbd_record
     enum xen_vbd_type type;
     char *qos_algorithm_type;
     xen_string_string_map *qos_algorithm_params;
+    struct xen_string_set *qos_supported_algorithms;
     struct xen_vbd_metrics_record_opt *metrics;
 } xen_vbd_record;
 
@@ -250,6 +252,13 @@ extern bool
 xen_vbd_get_qos_algorithm_params(xen_session *session, xen_string_string_map **result, xen_vbd vbd);
 
 
+/**
+ * Get the qos/supported_algorithms field of the given VBD.
+ */
+extern bool
+xen_vbd_get_qos_supported_algorithms(xen_session *session, struct xen_string_set **result, xen_vbd vbd);
+
+
 /**
  * Get the metrics field of the given VBD.
  */
index c6ec71ee035672e699bec27c51106ad72762dba4..bf1ea1e23b5a831cf06159be36552b6872566e25 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "xen_common.h"
 #include "xen_network_decl.h"
+#include "xen_string_set.h"
 #include "xen_string_string_map.h"
 #include "xen_vif_decl.h"
 #include "xen_vif_metrics_decl.h"
@@ -73,6 +74,7 @@ typedef struct xen_vif_record
     int64_t mtu;
     char *qos_algorithm_type;
     xen_string_string_map *qos_algorithm_params;
+    struct xen_string_set *qos_supported_algorithms;
     struct xen_vif_metrics_record_opt *metrics;
 } xen_vif_record;
 
@@ -239,6 +241,13 @@ extern bool
 xen_vif_get_qos_algorithm_params(xen_session *session, xen_string_string_map **result, xen_vif vif);
 
 
+/**
+ * Get the qos/supported_algorithms field of the given VIF.
+ */
+extern bool
+xen_vif_get_qos_supported_algorithms(xen_session *session, struct xen_string_set **result, xen_vif vif);
+
+
 /**
  * Get the metrics field of the given VIF.
  */
index 5e0b14dfbb1e2ee866d364cc712594407daf9a77..d050ff278476ac8ed9f11dfd142e8f5486a3cfa2 100644 (file)
@@ -72,6 +72,9 @@ static const struct_member xen_vbd_record_struct_members[] =
         { .key = "qos_algorithm_params",
           .type = &abstract_type_string_string_map,
           .offset = offsetof(xen_vbd_record, qos_algorithm_params) },
+        { .key = "qos_supported_algorithms",
+          .type = &abstract_type_string_set,
+          .offset = offsetof(xen_vbd_record, qos_supported_algorithms) },
         { .key = "metrics",
           .type = &abstract_type_ref,
           .offset = offsetof(xen_vbd_record, metrics) }
@@ -101,6 +104,7 @@ xen_vbd_record_free(xen_vbd_record *record)
     free(record->device);
     free(record->qos_algorithm_type);
     xen_string_string_map_free(record->qos_algorithm_params);
+    xen_string_set_free(record->qos_supported_algorithms);
     xen_vbd_metrics_record_opt_free(record->metrics);
     free(record);
 }
@@ -308,6 +312,23 @@ xen_vbd_get_qos_algorithm_params(xen_session *session, xen_string_string_map **r
 }
 
 
+bool
+xen_vbd_get_qos_supported_algorithms(xen_session *session, struct xen_string_set **result, xen_vbd vbd)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = vbd }
+        };
+
+    abstract_type result_type = abstract_type_string_set;
+
+    *result = NULL;
+    XEN_CALL_("VBD.get_qos_supported_algorithms");
+    return session->ok;
+}
+
+
 bool
 xen_vbd_get_metrics(xen_session *session, xen_vbd_metrics *result, xen_vbd vbd)
 {
index 62a6ef16a2454370955f22052cb71f3444613c94..3d7d2ad171edb5fffcabe3c976df00f559f9f933 100644 (file)
@@ -64,6 +64,9 @@ static const struct_member xen_vif_record_struct_members[] =
         { .key = "qos_algorithm_params",
           .type = &abstract_type_string_string_map,
           .offset = offsetof(xen_vif_record, qos_algorithm_params) },
+        { .key = "qos_supported_algorithms",
+          .type = &abstract_type_string_set,
+          .offset = offsetof(xen_vif_record, qos_supported_algorithms) },
         { .key = "metrics",
           .type = &abstract_type_ref,
           .offset = offsetof(xen_vif_record, metrics) }
@@ -94,6 +97,7 @@ xen_vif_record_free(xen_vif_record *record)
     free(record->mac);
     free(record->qos_algorithm_type);
     xen_string_string_map_free(record->qos_algorithm_params);
+    xen_string_set_free(record->qos_supported_algorithms);
     xen_vif_metrics_record_opt_free(record->metrics);
     free(record);
 }
@@ -288,6 +292,23 @@ xen_vif_get_qos_algorithm_params(xen_session *session, xen_string_string_map **r
 }
 
 
+bool
+xen_vif_get_qos_supported_algorithms(xen_session *session, struct xen_string_set **result, xen_vif vif)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = vif }
+        };
+
+    abstract_type result_type = abstract_type_string_set;
+
+    *result = NULL;
+    XEN_CALL_("VIF.get_qos_supported_algorithms");
+    return session->ok;
+}
+
+
 bool
 xen_vif_get_metrics(xen_session *session, xen_vif_metrics *result, xen_vif vif)
 {